package com.meituan.controller;

import com.meituan.model.ReplyEntity;
import com.meituan.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class ReplyController {
    @Autowired
    ReplyService replyService;

    @PostMapping("publishReply")
    public Map<String,Integer> publishReply(@RequestBody ReplyEntity replyEntity){
        Map<String,Integer> map = new HashMap<>();
        Integer result = replyService.add(replyEntity);
        if(result==1){
            map.put("err_code",0);
        }
        return map;
    }
}
